﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;

namespace WebLib.AuthorizeService
{
    public class Principal : IPrincipal
    {
        private string[] _roles;

        public Principal(IIdentity id, string[] roles)
        {
            Identity = id;
            _roles = roles;
        }


        #region IPrincipal 멤버

        public IIdentity Identity { get; private set; }

        public bool IsInRole(string role)
        {
            return _roles.Any(role.Equals);
        }

        #endregion
    }
}
